package com.ynding.cloud.auth.api.admin.client;

import com.ynding.cloud.auth.api.admin.client.fallback.UserClientFallback;
import com.ynding.cloud.common.dict.CloudServiceInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p> </p>
 *
 * @author ynding
 * @version 2021/6/11
 **/
@FeignClient(value = CloudServiceInfo.AUTH_SERVER_ADMIN,fallback = UserClientFallback.class)
@Component
public interface UserClient {

    /**
     * 根据用户名查找用户
     * @param username 用户名
     * @return
     */
    @GetMapping("/user/loadUserByUsername")
    UserDetails loadUserByUsername(@RequestParam("username") String username);
}
